package com.hcss.core.common.mailmgt.model;

import java.util.Properties;


/**
 * @ClassName: MailModel
 * @Description: TODO 邮件实体
 * @author lvfang
 * @date 2013-4-16 下午1:48:39
 * 
 */
public class MailModel {
	private String mailServerHost;
	private String mailServerPort;
	// 邮件发送者的地址
	private String fromAddress;
	// 邮件接收者的地址
	private String[] toAddress;
	// 登陆邮件发送服务器的用户名和密码
	private String userName;
	private String password;
	// 是否需要身份验证
	private boolean validate = true;
	// 邮件主题
	private String subject;
	// 邮件的文本内容
	private String content;

	// 抄送邮箱
	private String[] ccAddress;
	
	private String addressor;
	private String addressee;
	private String cc;
	private String subObject;
	private String emailContent;
	
	public MailModel() {
		// TODO Auto-generated constructor stub
	}
	
	public MailModel(String[] toAddress,String subject,String content) {
		this.toAddress = toAddress;
		this.subject = subject;
		this.content = content;
	}
	
	
	
	/**
	 * @return the addressor
	 */
	public String getAddressor() {
		return addressor;
	}

	/**
	 * @param addressor the addressor to set
	 */
	public void setAddressor(String addressor) {
		this.addressor = addressor;
	}

	/**
	 * @return the addressee
	 */
	public String getAddressee() {
		return addressee;
	}

	/**
	 * @param addressee the addressee to set
	 */
	public void setAddressee(String addressee) {
		this.addressee = addressee;
	}

	/**
	 * @return the cc
	 */
	public String getCc() {
		return cc;
	}

	/**
	 * @param cc the cc to set
	 */
	public void setCc(String cc) {
		this.cc = cc;
	}

	/**
	 * @return the subObject
	 */
	public String getSubObject() {
		return subObject;
	}

	/**
	 * @param subObject the subObject to set
	 */
	public void setSubObject(String subObject) {
		this.subObject = subObject;
	}

	/**
	 * @return the emailContent
	 */
	public String getEmailContent() {
		return emailContent;
	}

	/**
	 * @param emailContent the emailContent to set
	 */
	public void setEmailContent(String emailContent) {
		this.emailContent = emailContent;
	}

	/**
	 * @return the ccAddress
	 */
	public String[] getCcAddress() {
		return ccAddress;
	}

	/**
	 * @param ccAddress
	 *            the ccAddress to set
	 */
	public void setCcAddress(String[] ccAddress) {
		this.ccAddress = ccAddress;
	}

	/**
	 * 获得邮件会话属性
	 */
	public Properties getProperties() {
		Properties p = new Properties();
		p.put("mail.smtp.host", this.mailServerHost);
		p.put("mail.smtp.port", this.mailServerPort);
		p.put("mail.smtp.auth", "true");
		//邮件增加SSL 方式
		p.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
		p.put("mail.smtp.socketFactory.fallback", "false");
		p.put("mail.smtp.socketFactory.port", this.mailServerPort);
		return p;
	}

	public String getMailServerHost() {
		return mailServerHost;
	}

	public void setMailServerHost(String mailServerHost) {
		this.mailServerHost = mailServerHost;
	}

	public String getMailServerPort() {
		return mailServerPort;
	}

	public void setMailServerPort(String mailServerPort) {
		this.mailServerPort = mailServerPort;
	}

	public boolean isValidate() {
		return validate;
	}

	public void setValidate(boolean validate) {
		this.validate = validate;
	}

	public String getFromAddress() {
		return fromAddress;
	}

	public void setFromAddress(String fromAddress) {
		this.fromAddress = fromAddress;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String[] getToAddress() {
		return toAddress;
	}

	public void setToAddress(String[] toAddress) {
		this.toAddress = toAddress;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String textContent) {
		this.content = textContent;
	}
}
